package com.sofwin.service.impl;

import com.sofwin.mapper.SysMonitorMapper;
import com.sofwin.pojo.SysMonitor;
import com.sofwin.service.MonitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MonitorServiceImpl implements MonitorService {

    @Autowired
    private SysMonitorMapper mapper;

    @Override
    public void saveMonitor(Integer id, String url, String currDate, long request_date, String ip) {
        SysMonitor monitor = new SysMonitor();
        monitor.setUserId(id);
        monitor.setVisitIp(ip);
        monitor.setVisitUrl(url);
        monitor.setVisitDate(currDate);
        monitor.setRequestDate(String.valueOf(request_date));
        mapper.insertSelective(monitor);
    }
}

